﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;

namespace CPUAPI.Migrations
{
    public partial class init : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "CPUInfos",
                columns: table => new
                {
                    ID = table.Column<int>(type: "integer", nullable: false)
                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
                    Name = table.Column<string>(type: "VARCHAR(50)", nullable: false),
                    LastProduceTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
                    TotalCount = table.Column<int>(type: "integer", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CPUInfos", x => x.ID);
                });

            migrationBuilder.InsertData(
                table: "CPUInfos",
                columns: new[] { "ID", "LastProduceTime", "Name", "TotalCount" },
                values: new object[,]
                {
                    { 1, new DateTime(2022, 1, 12, 17, 48, 19, 501, DateTimeKind.Local).AddTicks(2394), "海思麒麟", 10 },
                    { 2, new DateTime(2022, 1, 12, 17, 48, 19, 501, DateTimeKind.Local).AddTicks(9927), "联发科", 10 },
                    { 3, new DateTime(2022, 1, 12, 17, 48, 19, 501, DateTimeKind.Local).AddTicks(9959), "高通晓龙", 10 },
                    { 4, new DateTime(2022, 1, 12, 17, 48, 19, 501, DateTimeKind.Local).AddTicks(9961), "苹果A系列", 10 }
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "CPUInfos");
        }
    }
}
